package com.ljf.tijian.mapper;

import com.ljf.tijian.pojo.Checkitem;
import com.ljf.tijian.pojo.Setmeal;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CheckitemMapper {
    int deleteByPrimaryKey(Integer ciId);

    int insert(Checkitem record);

    int insertSelective(Checkitem record);

    Checkitem selectByPrimaryKey(Integer ciId);

    int updateByPrimaryKeySelective(Checkitem record);

    int updateByPrimaryKey(Checkitem record);

    @Select("select c.ciId, c.ciName, c.ciContent, c.meaning, c.remarks" +
            "\n" +
            "from checkitem c,setmeal s,setmealdetailed sd "+
            "where s.smId=sd.smId and sd.ciId=c.ciId and s.smId = #{smId}"
    )
    List<Checkitem> listCheckItemBySmId(Setmeal setmeal);

    @Select("select ciId, ciName, ciContent, meaning, remarks from checkitem")
    List<Checkitem> selectAllCheckItem();
}